<?php
class Sinedria {
	public static function arxiothetisi($login) {
		$login = Globals::asfales_sql($login);
		$query = "INSERT INTO `istoriko` (`pektis`, `ip`, `isodos`, `exodos`) " .
			"SELECT `pektis`, `ip`, `isodos`, NOW() FROM `sinedria` WHERE `pektis` = " . $login;
		Globals::$db->query($query);
		$count = Globals::$db->affected_rows;
		if ($count == 0) return;

		$query = "DELETE FROM `sinedria` WHERE `pektis` = " . $login;
		Globals::$db->query($query);
		if (Globals::$db->affected_rows == $count) return;

		GLobals::klise_fige("Απέτυχε η αρχειοθέτηση προηγούμενης συνεδρίας");
	}
}
?>
